3.198 \(\int \frac {\cot ^2(a+i \log (x))}{x} \, dx\)

Optimal. Leaf size=18 \[ -\log (x)+i \cot (a+i \log (x)) \]

[Out]

I*cot(a+I*ln(x))-ln(x)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {3473, 8} \[ -\log (x)+i \cot (a+i \log (x)) \]

Antiderivative was successfully verified.

[In]

Int[Cot[a + I*Log[x]]^2/x,x]

[Out]

I*Cot[a + I*Log[x]] - Log[x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rubi steps

\begin {align*} \int \frac {\cot ^2(a+i \log (x))}{x} \, dx &=\operatorname {Subst}\left (\int \cot ^2(a+i x) \, dx,x,\log (x)\right )\\ &=i \cot (a+i \log (x))-\operatorname {Subst}(\int 1 \, dx,x,\log (x))\\ &=i \cot (a+i \log (x))-\log (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.05, size = 34, normalized size = 1.89 \[ i \cot (a+i \log (x)) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};-\tan ^2(a+i \log (x))\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[a + I*Log[x]]^2/x,x]

[Out]

I*Cot[a + I*Log[x]]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[a + I*Log[x]]^2]

________________________________________________________________________________________

fricas [B]  time = 0.60, size = 34, normalized size = 1.89 \[ -\frac {{\left (x^{2} - e^{\left (2 i \, a\right )}\right )} \log \relax (x) - 2 \, e^{\left (2 i \, a\right )}}{x^{2} - e^{\left (2 i \, a\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*log(x))^2/x,x, algorithm="fricas")

[Out]

-((x^2 - e^(2*I*a))*log(x) - 2*e^(2*I*a))/(x^2 - e^(2*I*a))

________________________________________________________________________________________

giac [B]  time = 0.31, size = 76, normalized size = 4.22 \[ \frac {i \, {\left (\tan \left (\frac {1}{2} \, a\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, a\right )^{2} + 1\right )}}{{\left (\frac {i \, {\left (x^{2} - 1\right )} \tan \left (\frac {1}{2} \, a\right )^{2}}{x^{2} + 1} - \frac {i \, {\left (x^{2} - 1\right )}}{x^{2} + 1} - 2 \, \tan \left (\frac {1}{2} \, a\right )\right )} {\left (\tan \left (\frac {1}{2} \, a\right )^{2} - 1\right )}} - \log \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*log(x))^2/x,x, algorithm="giac")

[Out]

I*(tan(1/2*a)^4 + 2*tan(1/2*a)^2 + 1)/((I*(x^2 - 1)*tan(1/2*a)^2/(x^2 + 1) - I*(x^2 - 1)/(x^2 + 1) - 2*tan(1/2
*a))*(tan(1/2*a)^2 - 1)) - log(x)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 27, normalized size = 1.50 \[ i \cot \left (a +i \ln \relax (x )\right )-\frac {i \pi }{2}+i \left (a +i \ln \relax (x )\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(a+I*ln(x))^2/x,x)

[Out]

I*cot(a+I*ln(x))-1/2*I*Pi+I*(a+I*ln(x))

________________________________________________________________________________________

maxima [A]  time = 0.42, size = 19, normalized size = 1.06 \[ i \, a + \frac {i}{\tan \left (a + i \, \log \relax (x)\right )} - \log \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*log(x))^2/x,x, algorithm="maxima")

[Out]

I*a + I/tan(a + I*log(x)) - log(x)

________________________________________________________________________________________

mupad [B]  time = 2.49, size = 16, normalized size = 0.89 \[ -\ln \relax (x)+\mathrm {cot}\left (a+\ln \relax (x)\,1{}\mathrm {i}\right )\,1{}\mathrm {i} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(a + log(x)*1i)^2/x,x)

[Out]

cot(a + log(x)*1i)*1i - log(x)

________________________________________________________________________________________

sympy [A]  time = 0.31, size = 20, normalized size = 1.11 \[ - \log {\relax (x )} + \frac {2 e^{2 i a}}{x^{2} - e^{2 i a}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*ln(x))**2/x,x)

[Out]

-log(x) + 2*exp(2*I*a)/(x**2 - exp(2*I*a))

________________________________________________________________________________________